package com.luotao.input;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;

/**
 * User: luotao
 * Date: 12-6-22
 * Time: 09:54
 */
public class TxtInput {
    public void input()throws Exception{
        File f = new File("E:\\project\\2012-06-21\\txt\\input.txt");
        FileReader fileReader = new FileReader(f);
        BufferedReader bufferedReader = new BufferedReader(fileReader);
        String s=null;
        while((s=bufferedReader.readLine())!=null){
            System.out.println("s = " + s);
        }
    }

    public static void main(String[] args) throws Exception {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring/app-config.xml") ;
        TxtInput txtInput = (TxtInput)context.getBean("txtInput");
        System.out.println(txtInput);
    }
}
